package com.sxbang.friday.dao;

import com.sxbang.friday.model.SysRoleUser;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface RoleUserDao {
    @Insert("insert into sys_role_user values(#{userId},#{roleId})")
    int insertUser(SysRoleUser sysRoleUser);
    @Delete("delete from sys_role_user where userId =#{userId};")
    int deleteUser(int userId);
    @Select("select * from sys_role_user ")
    List<SysRoleUser> selectUser();
    @Select("select * from sys_role_user where  userId = #{userId}")
    SysRoleUser getUser(int userId);
    @Update("update sys_role_user set roleId = #{roleId} where userId = #{userId}")
    int updateUser(SysRoleUser sysRoleUser);
    @Insert("insert into sys_role_user values(#{userId},#{roleId})")
    void save(SysRoleUser sysRoleUser);
    @Select("select * from sys_role_user t where t.userId = #{userId}")
    SysRoleUser getSysRoleUserByUserId(Integer userId);

    int updateSysRoleUser(SysRoleUser sysRoleUser);
    @Delete("delete from sys_role_user  where userId = #{userId}")
    int deleteRoleUserByUserId(Integer userId);
}
